<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="kines.ct.*"%>
<%
	int id_prospecto = request.getParameter("IdProspecto")!=null?Integer.parseInt(request.getParameter("IdProspecto")):-1;
	String accion = request.getParameter("accion");
	if( accion != null && accion.equals("agregar") ){
		String nombre = request.getParameter("Nombre");
		String aPaterno = request.getParameter("Apellido Paterno");
		String aMaterno = request.getParameter("Apellido Materno");
		String telefono = request.getParameter("Telefono");
		String apellidos[] = {aPaterno,aMaterno};
		Referred re = new Referred( );
		re.setProspectId( id_prospecto );
		re.setFirstName( nombre );
		re.setLastName( apellidos );
		re.setPhone( telefono );
		re.saveData( session );
		response.sendRedirect("../utils/actions_response.jsp");
	}
%>
<html>
<head>
<title>Listado de Referidos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../css/arastyle.css" type="text/css">
<script language="JavaScript1.2" src="../utils/funtions.js"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>

<body class="fondo">
<br>
<form action="AgregarReferidos.jsp" method="post" name="agregarReferido" onSubmit="MM_validateForm('Nombre','','R','Apellido Paterno','','R','Apellido Materno','','R','Telefono','','R');return document.MM_returnValue">
<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th colspan="2" class="titulos" scope="col">Agregar Personas Referidas</th>
  </tr>
  <tr>
    <td width="36%" class="etiqueta">Nombre(s):</td>
    <td width="64%"  bgcolor="#C2C2C2" ><input name="Nombre" type="text" class="textfields"></td>
  </tr>
  <tr>
    <td width="36%" class="etiqueta">Apellido Paterno:</td>
    <td width="64%"  bgcolor="#C2C2C2" ><input name="Apellido Paterno" type="text" class="textfields"></td>
  </tr>
  <tr>
    <td width="36%" class="etiqueta">Apellido Materno: </td>
    <td width="64%"  bgcolor="#C2C2C2" ><input name="Apellido Materno" type="text" class="textfields"></td>
  </tr>
  <tr>
    <td width="36%" class="etiqueta">Telefono:</td>
    <td width="64%"  bgcolor="#C2C2C2" ><input name="Telefono" type="text" class="textfields"></td>
  </tr>
  <tr>
    <td colspan="2"><div align="center">
      <input name="Submit2" type="button" class="boton" onClick="window.close();" value="Cerrar">
      &nbsp;&nbsp;
      <input name="Submit" type="submit" class="boton" value="Guardar">
      <input type="hidden" name="IdProspecto" value="<%=id_prospecto%>">
      <input type="hidden" name="accion" value="agregar">
</div></td>
  </tr>
</table>
<br>
<strong>*Todos los datos son necesarios</strong> <br>
</form>
</body>
</html>
